#ifndef ROCKET_COMMON_ERROR_CODER_H
#define ROCKET_COMMON_ERROR_CODER_H

#ifndef SYS_ERROR_PREFIX
#define SYS_ERROR_PREFIX(xx) 1000##xx
#endif

const int ERROR_PEER_CLOSED = SYS_ERROR_PREFIX(0000);      // Peer closed;
const int ERROR_FAILED_CONNECT = SYS_ERROR_PREFIX(0001);   // Fail to connect;
const int ERROR_FAILED_GET_REPLY = SYS_ERROR_PREFIX(0002); // Fail to get reply;
const int ERROR_FAILED_DESERIALIZE =
    SYS_ERROR_PREFIX(0003); // Fail to deserialize;
const int ERROR_FAILED_SERIALIZE = SYS_ERROR_PREFIX(0004); // Fail to serialize;

const int ERROR_FAILED_ENCODE = SYS_ERROR_PREFIX(0005); // Fail to encode;
const int ERROR_FAILED_DECODE = SYS_ERROR_PREFIX(0006); // Fail to decode;

const int ERROR_RPC_CALL_TIMEOUT =
    SYS_ERROR_PREFIX(0007); // RPC invoke timeout;

const int ERROR_SERVICE_NOT_FOUND =
    SYS_ERROR_PREFIX(0008); // RPC Service not found;
const int ERROR_METHOD_NOT_FOUND =
    SYS_ERROR_PREFIX(0009); // RPC Method not found;
const int ERROR_PARSE_SERVICE_NAME =
    SYS_ERROR_PREFIX(0010); // Service name parse failed;

const int ERROR_RPC_CHANNEL_INIT =
    SYS_ERROR_PREFIX(0011); // rpc channel init failed
#endif
